{include file="public/header" /}
<style type="text/css">
    .option{
        text-decoration:underline;
        color:#95a5a6
    }
</style>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="javascript:;">角色管理</a></li>
        <li><a href="{:url('authGroup/add',array('action' => 'add'))}">添加角色</a></li>
    </ul>
    <form method="post" action="{:url('authGroup/index')}">
        <div  class="well form-inline " >
            关键字:
            <input type="text" class="form-control" name="keyword" style="width: 200px;"
                   value="{$params['keyword']|default=''}" placeholder="请输入关键字...">
            <input type="submit" class="btn btn-primary" value="搜索"/>
            <a class="btn btn-danger" href="{:url('authGroup/index')}">清空</a>
        </div>
        <table class="table table-hover table-bordered table-list">
            <thead>
            <tr>
                <th>ID</th>
                <th>角色名称</th>
                <th>拥有的权限</th>
                <th>角色描述</th>
                <th>状态</th>
                <th>创建时间</th>
                <th>操作</th>
            </tr>
            </thead>
            {foreach name="list" item="vo"}
            <tr>
                <td>{$vo.id}</td>
                <td width="100">{$vo.name}</td>
                <td>{$vo.rulesName}</td>
                <td width="150">{$vo.description}</td>
                <td width="100">
                    {if condition="$vo['status'] eq '1'"}
                    <span style="color: #18bc9c;">启用</span>
                    {else /}
                    <span style="color: #e74c3c;">禁用</span>
                    {/if}
                </td>
                <td width="150">{$vo.createTime}</td>
                <td width="150">
                    {if condition="$vo['id'] eq 1"}
                        <span class="option">设置权限　编辑</span>
                    {else /}
                        <a href="{:url('authGroup/authorize',array('action'=>'edit','id'=>$vo['id']))}">设置权限</a>　
                        <a href="{:url('authGroup/edit',array('action'=>'edit','id'=>$vo['id']))}">编辑</a>
                    {/if}
                </td>
            </tr>
            {/foreach}
        </table>
    </form>
</div>
<script src="{$static}js/admin.js"></script>
</body>
</html>